package com.sukaiyi.giteeideaplugin.utils;

import java.awt.*;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

public class BrowseUtils {

    private BrowseUtils(){

    }

    public static void open(String url){
        Desktop desktop = Desktop.getDesktop();
        if (Desktop.isDesktopSupported() && desktop.isSupported(Desktop.Action.BROWSE)) {
            try {
                URI uri = new URI(url);
                desktop.browse(uri);
            } catch (URISyntaxException | IOException e) {
                e.printStackTrace();
            }
        }
    }

}
